---@diagnostic disable: undefined-global

--- 誓北技能
--- 锁定技，手牌数奇偶性与你不同的角色对你造成伤害时，你令伤害-1并摸一张牌。
local shibei = fk.CreateSkill{
  name = "ls__shibei",
  tags = { Skill.Compulsory },
}

shibei:addEffect(fk.DamageInflicted, {
  can_trigger = function(self, event, target, player, data)
    return target == player and data.from and (player:getHandcardNum() % 2) ~= (data.from:getHandcardNum() % 2)
    and player:hasSkill(shibei.name)
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, shibei.name)
    data:changeDamage(-1)
  end,
})

Fk:loadTranslationTable{
  ["ls__shibei"] = "誓北",
  [":ls__shibei"] = "锁定技，手牌数奇偶性与你不同的角色对你造成伤害时，你令伤害-1并摸一张牌。",
  
  ["$ls__shibei1"] = "誓守北境，虽死无悔！",
  ["$ls__shibei2"] = "北地风霜，炼我铮铮铁骨！",
}

return shibei